package com.myfum.mobile.tetris.commands
{
	import com.myfum.mobile.tetris.data.TetrisMap;
	import com.myfum.mobile.tetris.data.shapes.ShapeFactory;
	import com.myfum.mobile.tetris.data.shapes.ShapeType;
	
	import org.robotlegs.mvcs.Command;
	
	public class MapUpdateCommand extends Command
	{
		[Inject]
		public var map:TetrisMap;
		
		public function MapUpdateCommand()
		{
			super();
		}
		
		override public function execute():void{
			//first check if there is a explodable line
			map.cleanUpLine();
			//them append a new shape
			map.appendShape(ShapeFactory.createRandomShape());
		}
	}
}